package com.anli.config;

import com.anli.lockCelue.LockCeLue;
import com.anli.lockCelue.LockCeLueFactory;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/3/9  11:01
 * 描述:
 */
@Component("myRedisMesageLIstener2")
public class MyRedisMesageLIstener2 implements MessageListener {

    @Override
    public void onMessage(Message message, byte[] bytes) {

        System.out.println("==========取出数据=========");
        //我们的数据
        String string=new String(message.getBody());
        //我们的通道名称
        String channelName=new String(bytes);

        LockCeLue ceLue = LockCeLueFactory.getCeLue(channelName);
        ceLue.lockCelue(string);
    }
}
